from pms.common.views import PostFormula
from info.utils.notice import update_notice, notice_view
from info.models import Notice


class API(PostFormula):

    def handle(self, req):
        return self.success_respond(
            notice_view(
                update_notice(
                    notice=Notice.objects.get(id=req['id']),
                    user=self.user,
                    view=req['mod']
                )
            )
        )
